package com.zheng.study.company.service;

import com.zheng.study.base.service.BaseService;
import com.zheng.study.company.entity.Company;
import com.zheng.study.company.entity.Department;
import com.zheng.study.company.entity.Power;
import com.zheng.study.company.entity.User;

import java.util.List;
import java.util.Map;

/**
 * newFile
 * ============================================================================
 * author : dzw
 * createDate:  2018/8/24 。
 * ============================================================================
 */
public interface PowerService extends BaseService<Power, String> {

	/**
	 * 获取职权同级及上级部门职权列表
	 */
	List<Power> getLevelPowers(Company company, Department department);

	/**
	 * 企业下同级及上级部门职权 Map Tree
	 */
	List<Map<String, Object>> getLevelTreeMapList(Company company, Department department, Power exceptPower);

	/**
	 * 获取最顶级职权列表
	 */
	List<Power> getRootPowerList(Company company);

	/**
	 * 获取所有职权Map tree
	 */
	List<Map<String, Object>> getLevelTreeMapList(Company company);
	List<Map<String, Object>> getLevelTreeMapList(Company company, User user);

	/**
	 * 判断一个职权是否拥有子职权
	 */
	boolean checkIsHasChildren(Power power);

	/**
	 * 获取一个用户当前拥有的职权
	 */
	List<Power> getPowerListByUser(User user);

}
